<?php echo $this->render('/public/header');?>
<div id="main" class="col-xs-12">
	<a href="javascript:window.history.go(-1);" class="btn btn-success">返回</a>
	<div class="alert alert-success" style="float:right;">净额统计<?php echo $this->params['all_clean'];?></div>
	<div class="alert alert-info" style="float:right;">收入统计<?php echo $this->params['all_income'];?></div>
	<table class="table table-borderd">
		<thead>
			<tr>
				<th>date</th>
				<th>invoice</th>
				<th>pi</th>
				<th>客户编号</th>
				<th>客户名称</th>
				<th>产品</th>
				<th>业务员</th>
				<th>invoice总金额</th>
				<th>收入</th>
				<th>支出</th>
				<th>费用</th>
				<th>净额</th>
			</tr>
		</thead>
		<?php foreach ($this->params['list']['list'] as $k => $v) { ?>
		<tr>
			<td><?php echo $v['date'];?></td>
			<td><?php echo $v['invoice'];?></td>
			<td><?php echo $v['pi'];?></td>
			<td><?php echo $v['customer_num'];?></td>
			<td><?php echo $v['customer_name'];?></td>
			<td><?php echo $v['product'];?></td>
			<td><?php echo $v['saleman'];?></td>
			<td><?php echo $v['order_pay'];?></td>
			<td><?php echo isset($v['income'])?$v['income']['in_come']:0;?></td>
			<td><?php echo isset($v['income'])?$v['income']['total_fee']:0;?></td>
			<td><?php echo isset($v['income'])?$v['income']['fee']:0;?></td>
			<td><?php echo isset($v['income'])?($v['income']['in_come']+$v['income']['total_fee']+$v['income']['fee']):0;?></td>
		</tr>
		<?php } ?>
	</table>
</div>
<?php echo $this->render('/public/footer');?>